﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class DanhMuc_ChonDonViThemDoanVien : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            MemberShip_ASP.BindDrop(drldonvi, this.Page.User.Identity.Name);
        }
    }
    protected void btnImport_Click(object sender, EventArgs e)
    {
        SecurityLib.Sec_AES _ps = new SecurityLib.Sec_AES();
        if (drldonvi.SelectedValue.ToString() == "0")
        {
            lblthongbao.Text = "Chưa chọn đơn vị.";
        }
        else
        {
            string subid = _ps.Decrypt(Request.QueryString["subid"].Replace(" ", "+"),"gold",128);
            if (subid == "1")//thêm mới đoàn viên
            {
                Response.Redirect(PageURL.local + "DanhMuc/ThemMoiDoanVien.aspx?id=" + _ps.Encrypt("4", "gold", 128) + "&subid=" + _ps.Encrypt("1", "gold", 128) + "&dvid=" + _ps.Encrypt(drldonvi.SelectedValue.ToString(), "gold", 128) + "&tid=" + _ps.Encrypt(drldonvi.SelectedItem.Text, "gold", 128));
            }
            else if (subid == "2")//quan ly doan vien
            {
                Response.Redirect(PageURL.local + "DanhMuc/QuanLyDoanVien.aspx?id=" + _ps.Encrypt("4", "gold", 128) + "&subid=" + _ps.Encrypt("2", "gold", 128) + "&dvid=" + _ps.Encrypt(drldonvi.SelectedValue.ToString(), "gold", 128) + "&tid=" + _ps.Encrypt(drldonvi.SelectedItem.Text, "gold", 128));
            }
            else if (subid == "3")//danh sach doan vien truong thanh
            {
                Response.Redirect(PageURL.local + "DanhMuc/DSDoanVienTruongThanh.aspx?id=" + _ps.Encrypt("4", "gold", 128) + "&subid=" + _ps.Encrypt("3", "gold", 128) + "&dvid=" + _ps.Encrypt(drldonvi.SelectedValue.ToString(), "gold", 128) + "&tid=" + _ps.Encrypt(drldonvi.SelectedItem.Text, "gold", 128));
            }
            else if (subid == "4")//danh sach doan vien truong thanh
            {
                Response.Redirect(PageURL.local + "DanhMuc/DSDoanVienDanhDu.aspx?id=" + _ps.Encrypt("4", "gold", 128) + "&subid=" + _ps.Encrypt("4", "gold", 128) + "&dvid=" + _ps.Encrypt(drldonvi.SelectedValue.ToString(), "gold", 128) + "&tid=" + _ps.Encrypt(drldonvi.SelectedItem.Text, "gold", 128));
            }
            else if (subid == "5")//danh sach doan vien truong thanh
            {
                Response.Redirect(PageURL.local + "DanhMuc/DSDoanVienGioiThieuDang.aspx?id=" + _ps.Encrypt("4", "gold", 128) + "&subid=" + _ps.Encrypt("5", "gold", 128) + "&dvid=" + _ps.Encrypt(drldonvi.SelectedValue.ToString(), "gold", 128) + "&tid=" + _ps.Encrypt(drldonvi.SelectedItem.Text, "gold", 128));
            }
            else if (subid == "6")//danh sach doan vien truong thanh
            {
                Response.Redirect(PageURL.local + "DanhMuc/DSDoanVienBiXoa.aspx?id=" + _ps.Encrypt("4", "gold", 128) + "&subid=" + _ps.Encrypt("6", "gold", 128) + "&dvid=" + _ps.Encrypt(drldonvi.SelectedValue.ToString(), "gold", 128) + "&tid=" + _ps.Encrypt(drldonvi.SelectedItem.Text, "gold", 128));
            }
            else if (subid == "7")//danh sach doan vien truong thanh
            {
                Response.Redirect(PageURL.local + "DanhMuc/DSDoanVienDuBi.aspx?id=" + _ps.Encrypt("4", "gold", 128) + "&subid=" + _ps.Encrypt("7", "gold", 128) + "&dvid=" + _ps.Encrypt(drldonvi.SelectedValue.ToString(), "gold", 128) + "&tid=" + _ps.Encrypt(drldonvi.SelectedItem.Text, "gold", 128));
            }
            else if (subid == "8")//danh sach doan vien truong thanh
            {
                Response.Redirect(PageURL.local + "DanhMuc/DSChuyenSinhHoatDoan.aspx?id=" + _ps.Encrypt("4", "gold", 128) + "&subid=" + _ps.Encrypt("8", "gold", 128) + "&dvid=" + _ps.Encrypt(drldonvi.SelectedValue.ToString(), "gold", 128) + "&tid=" + _ps.Encrypt(drldonvi.SelectedItem.Text, "gold", 128));
            }
            else if (subid == "9")//danh sach doan vien truong thanh
            {
                Response.Redirect(PageURL.local + "DanhMuc/DSDoanVienBiKhaiTru.aspx?id=" + _ps.Encrypt("4", "gold", 128) + "&subid=" + _ps.Encrypt("9", "gold", 128) + "&dvid=" + _ps.Encrypt(drldonvi.SelectedValue.ToString(), "gold", 128) + "&tid=" + _ps.Encrypt(drldonvi.SelectedItem.Text, "gold", 128));
            }
            else if (subid == "10")//danh sach doan vien truong thanh
            {
                Response.Redirect(PageURL.local + "DanhMuc/DanhSachCanBoDoan.aspx?id=" + _ps.Encrypt("4", "gold", 128) + "&subid=" + _ps.Encrypt("10", "gold", 128) + "&dvid=" + _ps.Encrypt(drldonvi.SelectedValue.ToString(), "gold", 128) + "&tid=" + _ps.Encrypt(drldonvi.SelectedItem.Text, "gold", 128));
            }
        }
    }
}